package base;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import Domain.News;

public class FirstApp2 {

	public static void main(String[] args) {
		Configuration configure = new Configuration().configure();
		SessionFactory sessionFactory = configure.buildSessionFactory();
		Session session = sessionFactory.openSession();

		Transaction transaction = session.beginTransaction();

		News news = new News("tom", "dgw");
		session.save(news);

		transaction.commit();

		session.close();
		sessionFactory.close();

	}

}
